Zhiyong Zhang's Psychometric Website
 
Home Control Panel Login Register Search Submit Logout About me Contact me
My Research
Google
Web
This Site
Home > SAS: Transpose data scripts
SAS: Transpose data scripts
2005-05-07    Zhang, Z.       Read: 10789 times
Cite this page: Zhang, Z. (2005). SAS: Transpose data scripts. Retrieved November 21, 2024, from https://www.psychstat.org/us/article.php/9.htm.
SAS: Transpose data scripts

/************************************************************/
/* Transpose data with proc iml                                                                      */
/* By Johnny  Zhang                                                                                        */
/* July 12, 2004                                                                                               */
/************************************************************/
data temp;
infile "C:\PROGRAM\datt.dat";
input
#1 pno vno t1-t26
#2 t27-t52
#3 t53-t78
#4 t79-t103;
run;

proc sort data=temp;
by pno;
run;

proc iml;
use temp;
start;
read all var _num_ into x;
y=t(x);
print y;
create temp1 from y;
append from y;
finish;
run;
quit;
/*
proc print data=temp1;
run;
*/
data temp2;
set temp1;
file "C:\PROGRAM\data.dat";
put col1-col30;
run;

Submitted by: johnny
Add a comment View comment Add to my favorite Email to a friend Print
If you want to rate, please login first, or click here to register. Or you can use USERNAME: guest and PASSWORD: guest to log in.
Average score 0, based on 0 comments
1 2 3 4 5 6 7 8 9 10
Copyright © 2003-13 Zhiyong Zhang \'s Psychometric Website
Maintained by Zhiyong Zhang